<?php
// +----------------------------------------------------------------------
// | Yzncms [ 御宅男工作室 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2018 http://yzncms.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: 御宅男 <530765310@qq.com>
// +----------------------------------------------------------------------

// +----------------------------------------------------------------------
// | 登录验证
// +----------------------------------------------------------------------
namespace app\app\validate;

use think\Validate;

class Business extends Validate
{

    //定义验证规则
    protected $rule = [
        'province|省' => 'require',
        'city|市' => 'require',
        'area|区' => 'require',
        'address|详细地址' => 'require',
        'business_name|服务站名称' => 'require',
        'username|用户名' => 'require',
        'password|密码' => 'require',
        'name|用户名' => 'require',
        'phone|电话' => 'require',
        'id_font|身份证正面照' => 'require',
        'id_back|身份证反面' => 'require',
        'business_license|营业执照' => 'require',
    ];

    // 登录验证场景定义
//    public function sceneUpdate()
//    {
//        return $this->only(['username', 'password', 'email', 'mobile', 'roleid'])
//            ->remove('password', 'require');
//    }

    //定义验证场景
    protected $scene = [
        'insert' => ['province', 'city', 'area', 'address', 'business_name', 'username', 'password', 'name', 'phone', 'id_font', 'id_back', 'business_license'],
    ];

}
